﻿/***************************************************************
 * 开发人员：网魂小兵@http://www.mozlite.com
 * 
 * 目标标本：4.0.30319.239
 * 
 * 最后修改：2011/12/17 0:10:51
 * ************************************************************/
namespace Mozlite.Web.UI.Areas.ControlPanel
{
    using System;
    using System.Linq;
    using System.Text;
    using System.Collections.Generic;
    using Mozlite.Common;
    using System.Web.Mvc;

    /// <summary>
    /// 控制面板路由注册。
    /// </summary>
    public class CUrls : BaseControlPanelAreaRegistration
    {
        /// <summary>
        /// 初始化类<see cref="T:Mozlite.Web.UI.Areas.ControlPanel.CUrls"/>。
        /// </summary>
        public CUrls() { }

        /// <summary>
        /// 注册区域路由。
        /// </summary>
        /// <param name="context">区域注册上下文实例对象。</param>
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.BeginRegister();
            //home
            context.RegisterControllerAction("home", "threadsview", ApplicationType.Blog, false);
            context.Register(Home_ThreadsPagerView, "$root:threadsview/{page}", new { controller = "home", action = "threadsview", applicationtype = ApplicationType.Blog, page = UrlParameter.Optional }, new { page = "\\d+"});
            context.RegisterControllerAction("home", "threadview", ApplicationType.Blog, false);
            context.RegisterControllerAction("home", "commonview", ApplicationType.Blog, false);
            context.RegisterControllerAction("home", "categoryview", ApplicationType.Blog, false);
            context.RegisterControllerAction("home", "themeview", ApplicationType.Blog, false);

            //host
            context.RegisterControllerAction("host","controlpanelview");
            context.RegisterControllerAction("host","index");
            context.RegisterControllerAction("host","appview");
            context.RegisterControllerAction("host","settingview");
            context.RegisterControllerAction("host","urlview");
            context.RegisterControllerAction("host","permissionview");
            context.RegisterControllerAction("host", "logview");
            context.Register(Host_LogPagerView, "$root:host/logview/{page}", new { controller = "host", action = "logview", page = UrlParameter.Optional }, new { page = "\\d+" });
            context.RegisterControllerAction("host","taskview");

            //user
            context.RegisterControllerAction("ucenter", "ucenterview");
            context.RegisterControllerAction("ucenter", "rolesview");
            context.RegisterControllerAction("ucenter", "permissionview");

            //forums
            context.RegisterControllerAction("forum", "settingsview");
            context.RegisterControllerAction("forum", "permissionschemaview");
            context.RegisterControllerAction("dialog", "forumpermissionschemaview");
            context.RegisterControllerAction("forum", "forumsview");
            context.RegisterControllerAction("forum", "newforumview");
            context.MapRoute(RouteManager.GetRouteName(context.AreaName, Dialog_ResetApplication), context.AreaName + "/Dialog/Reset", new { controller = "dialog", action = "reset" });
            context.Register(Home_NavigatorView, "$root:themes/{key}/navigatorview", new { controller = "home", action = "navigatorview" });
            context.Register(Dialog_NavigatorView, "$root:dialog/themes/{key}/navigatorview", new { controller = "dialog", action = "navigatorview" });
            //dialog
            context.RegisterControllerAction("dialog", "urlview");
            context.RegisterControllerAction("dialog", "logview");
            context.RegisterControllerAction("dialog", "hostview");
            context.RegisterControllerAction("dialog", "roleview");
            context.RegisterControllerAction("dialog", "categoryview");

            //首页
            context.EndRegister();
        }
        /// <summary>
        /// 重启应用程序。
        /// </summary>
        private const string Dialog_ResetApplication = "dialog_resetapplicationview";
        /// <summary>
        /// 导航。
        /// </summary>
        private const string Home_NavigatorView = "navigatorview";
        /// <summary>
        /// 导航信息。
        /// </summary>
        private const string Dialog_NavigatorView = "dialog_navigatorview";
        /// <summary>
        /// URL地址路由。
        /// </summary>
        private const string Dialog_UrlView = "dialog_urlview";
        /// <summary>
        /// 日志信息。
        /// </summary>
        private const string Dialog_LogView = "dialog_logview";
        /// <summary>
        /// 主机信息。
        /// </summary>
        private const string Dialog_HostView = "dialog_hostview";
        /// <summary>
        /// 角色信息。
        /// </summary>
        private const string Dialog_RoleView = "dialog_roleview";
        /// <summary>
        /// 分类信息。
        /// </summary>
        private const string Dialog_CategoryView = "dialog_categoryview";
        /// <summary>
        /// 论坛设置。
        /// </summary>
        private const string Forum_SettingsView = "forum_settingsview";
        /// <summary>
        /// 论坛权限方案。
        /// </summary>
        private const string Forum_PermissionSchemaView = "forum_permissionschemaview";
        /// <summary>
        /// 权限方案信息。
        /// </summary>
        private const string Dialog_ForumPermissionSchemaView = "dialog_forumpermissionschemaview";
        /// <summary>
        /// 论坛列表。
        /// </summary>
        private const string Forum_ForumsView = "forum_forumsview";
        /// <summary>
        /// 新建论坛。
        /// </summary>
        private const string Forum_NewForumView = "forum_newforumview";
        /// <summary>
        /// 用户管理。
        /// </summary>
        private const string UCenter_UCenterView = "ucenter_ucenterview";
        /// <summary>
        /// 用户组。
        /// </summary>
        private const string UCenter_RolesView = "ucenter_rolesview";
        /// <summary>
        /// 用户权限。
        /// </summary>
        private const string UCenter_PermissionView = "ucenter_permissionview";
        /// <summary>
        /// 后台设置。
        /// </summary>
        private const string Host_ControlpanelView = "host_controlpanelview";
        /// <summary>
        /// 网站域名。
        /// </summary>
        private const string Host_Index = "host_index";
        /// <summary>
        /// 应用程序列表。
        /// </summary>
        private const string Host_AppView = "host_appview";
        /// <summary>
        /// 基本设置。
        /// </summary>
        private const string Host_SettingView = "host_settingview";
        /// <summary>
        /// Url路由设置。
        /// </summary>
        private const string Host_UrlView = "host_urlview";
        /// <summary>
        /// 后台权限。
        /// </summary>
        private const string Host_PermissionView = "host_permissionview";
        /// <summary>
        /// 日志列表。
        /// </summary>
        private const string Host_LogView = "host_logview";
        /// <summary>
        /// 日志分页列表。
        /// </summary>
        private const string Host_LogPagerView = "host_logpagerview";
        /// <summary>
        /// 后台任务列表。
        /// </summary>
        private const string Host_TaskView = "host_taskview";

        /// <summary>
        /// 主题列表。
        /// </summary>
        private const string Home_ThreadsPagerView = "home_threadspagerview";
        /// <summary>
        /// 主题列表。
        /// </summary>
        private const string Home_ThreadsView = "home_threadsview";
        /// <summary>
        /// 主题信息。
        /// </summary>
        private const string Home_ThreadView = "home_threadview";
        /// <summary>
        ///  通用应用程序设置。
        /// </summary>
        private const string Home_CommonView = "home_commonview";
        /// <summary>
        /// 分类管理。
        /// </summary>
        private const string Home_CategoryView = "home_categoryview";
        /// <summary>
        /// 模板管理。
        /// </summary>
        private const string Home_ThemeView = "home_themeview";

        /// <summary>
        /// 重启应用程序。
        /// </summary>
        public static string ResetApplication  { get { return FormatUrl(Dialog_ResetApplication); } }

        /// <summary>
        /// 获取导航列表管理地址。
        /// </summary>
        /// <param name="key">模板文件夹名称。</param>
        /// <returns>返回URL地址。</returns>
        public static string GetNavigatorListUrl(string key)
        {
            return FormatUrl(Home_NavigatorView, new { key = key });
        }
        /// <summary>
        /// 获取导航窗口地址。
        /// </summary>
        /// <param name="key">模板文件夹名称。</param>
        /// <returns>返回URL地址。</returns>
        public static string GetDialogNavigatorUrl(string key)
        {
            return FormatUrl(Dialog_NavigatorView, new { key = key });
        }
        /// <summary>
        /// URL地址路由。
        /// </summary>
        public static string DialogUrlView  { get { return  FormatUrl(Dialog_UrlView); } }
        /// <summary>
        /// 日志信息。
        /// </summary>
        public static string DialogLogView  { get { return FormatUrl(Dialog_LogView); } }
        /// <summary>
        /// 主机信息。
        /// </summary>
        public static string DialogHostView  { get { return FormatUrl(Dialog_HostView); } }
        /// <summary>
        /// 角色信息。
        /// </summary>
        public static string DialogRoleView  { get { return FormatUrl(Dialog_RoleView); } }
        /// <summary>
        /// 分类信息。
        /// </summary>
        public static string DialogCategoryView  { get { return FormatUrl(Dialog_CategoryView); } }

        /// <summary>
        /// 论坛设置。
        /// </summary>
        public static string ForumSettingsView  { get { return  FormatUrl(Forum_SettingsView); } }
        /// <summary>
        /// 论坛权限方案。
        /// </summary>
        public static string ForumPermissionSchemaView  { get { return  FormatUrl(Forum_PermissionSchemaView); } }
        /// <summary>
        /// 权限方案信息。
        /// </summary>
        public static string DialogForumPermissionSchemaView  { get { return  FormatUrl(Dialog_ForumPermissionSchemaView); } }
        /// <summary>
        /// 论坛列表。
        /// </summary>
        public static string ForumsView  { get { return  FormatUrl(Forum_ForumsView); } }
        /// <summary>
        /// 新建论坛。
        /// </summary>
        public static string NewForumView  { get { return  FormatUrl(Forum_NewForumView); } }

        /// <summary>
        /// 用户管理。
        /// </summary>
        public static string UCenterView  { get { return  FormatUrl(UCenter_UCenterView); } }
        /// <summary>
        /// 用户组。
        /// </summary>
        public static string UCenterRolesView  { get { return  FormatUrl(UCenter_RolesView); } }
        /// <summary>
        /// 用户权限。
        /// </summary>
        public static string UCenterPermissionView  { get { return  FormatUrl(UCenter_PermissionView); } }

        /// <summary>
        /// 后台设置。
        /// </summary>
        public static string HostControlpanelView  { get { return  FormatUrl(Host_ControlpanelView);} }
        /// <summary>
        /// 网站域名。
        /// </summary>
        public static string HostIndex  { get { return  FormatUrl(Host_Index);} }
        /// <summary>
        /// 应用程序列表。
        /// </summary>
        public static string HostAppView  { get { return  FormatUrl(Host_AppView);} }
        /// <summary>
        /// 基本设置。
        /// </summary>
        public static string HostSettingView  { get { return  FormatUrl(Host_SettingView);} }
        /// <summary>
        /// Url路由设置。
        /// </summary>
        public static string HostUrlView  { get { return  FormatUrl(Host_UrlView);} }
        /// <summary>
        /// 后台权限。
        /// </summary>
        public static string HostPermissionView  { get { return  FormatUrl(Host_PermissionView);} }
        /// <summary>
        /// 日志列表。
        /// </summary>
        public static string HostLogView  { get { return  FormatUrl(Host_LogView);} }

        /// <summary>
        /// 日志分页列表。
        /// </summary>
        public static string GetHostLogView(int page) { return FormatUrl(Host_LogPagerView, new { page = page }); }
        /// <summary>
        /// 后台任务列表。
        /// </summary>
        public static string HostTaskView  { get { return FormatUrl(Host_TaskView);} }

        /// <summary>
        /// 主题列表。
        /// </summary>
        public static string GetThreadsView(int page) { return FormatUrl(Home_ThreadsPagerView, new { page = page }); }
        /// <summary>
        /// 主题列表。
        /// </summary>
        public static string ThreadsView { get { return FormatUrl(Home_ThreadsView);} }
        /// <summary>
        /// 主题信息。
        /// </summary>
        public static string ThreadView  { get { return FormatUrl(Home_ThreadView);} }
        /// <summary>
        ///  通用应用程序设置。
        /// </summary>
        public static string CommonView  { get { return  FormatUrl(Home_CommonView);} }
        /// <summary>
        /// 分类管理。
        /// </summary>
        public static string CategoryView  { get { return  FormatUrl(Home_CategoryView);} }
        /// <summary>
        /// 模板管理。
        /// </summary>
        public static string ThemeView  { get { return  FormatUrl(Home_ThemeView);} }
        /// <summary>
        /// 获取文件浏览列表地址。
        /// </summary>
        public static string DialogDiskUrl { get { return Mozlite.Web.UI.Areas.UCenter.UCenterUrls.DialogDiskView; } }
    
    }
}